#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define int long long
using namespace std;
int a[100003];
bool life[100003],vis[100003];
signed main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int n;
    bool flag=1;
    scanf("%lld",&n);
    for(int i=1;i<=n;i++){
        scanf("%lld",&a[i]);
        if(!(a[i]==1 or a[i]==2)) flag=0;
    }
    if(flag){
        int one=0,two=0;
        for(int i=1;i<=n;i++)
            if(a[i]==1) one++;
            else two++;
        if(one>two) cout<<n-two;
        else cout<<n-one;
        return 0;
    }
    sort(a+1,a+n+1);
    memset(life,1,sizeof(life));
    memset(vis,1,sizeof(vis));
    bool f=1;
    while(f){
        bool f2=0;
        for(int i=1;i<=n;i++){
            if(vis[i] and life[i]){
                for(int j=i-1;j>0;j--){
                    if(a[i]>a[j] and life[j]){
                        vis[i]=0;
                        vis[j]=0;
                        life[j]=0;
                        f2=1;
                        break;
                    }
                }
                //if(f2) break;
            }
        }
        if(!f2) break;
        //for(int i=1;i<=n;i++) cout<<vis[i]<<' ';
        //cout<<'\n';
        //for(int i=1;i<=n;i++) cout<<life[i]<<' ';
        //cout<<'\n';
        bool ff=1;
        for(int i=1;i<=n;i++)
            if(vis[i]){
                ff=0;
                break;
            }
        if(ff) f=0;
    }
    int ans=0;
    for(int i=1;i<=n;i++)
        if(life[i]) ans++;
    printf("%lld",ans);
    return 0;
}
